package com.leha.mp.core.handler;

import com.leha.mp.core.entity.mybatis.MpDoctorCode;
import me.chanjar.weixin.mp.bean.template.WxMpTemplateData;
import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage;

import java.util.ArrayList;
import java.util.List;

public class TicketHelper {
    public static WxMpTemplateMessage VideoTemplateMsgBuilder(MpDoctorCode code, String openid) {
        List<WxMpTemplateData> tmplateDatas = new ArrayList<>();
        WxMpTemplateData first = new WxMpTemplateData("first", "恭喜你加入"+code.getDoctorId()+"医生的班级");
        WxMpTemplateData keywords1 = new WxMpTemplateData("keywords1", code.getDoctorId().toString());
        WxMpTemplateData keywords2 = new WxMpTemplateData("keywords2", code.getInsertTime().toString());
        WxMpTemplateData remark = new WxMpTemplateData("remark", "感谢你的加入，请注意留意班级作业动态。");
        tmplateDatas.add(first);
        tmplateDatas.add(keywords1);
        tmplateDatas.add(keywords2);
        tmplateDatas.add(remark);

        return
                WxMpTemplateMessage.builder().templateId("ZiRV62iQl2GM9misKQRxhHSU8wUtsGTEp3PEAj5_A-Y")
                        .toUser(openid)
                        .url("https://m.qlchat.com/live/channel/channelPage/2000001316850291.htm")
                      //  .miniProgram(new WxMpTemplateMessage.MiniProgram("wx8351c3df3895360a",
                      //          "/pages/doctor/doctor?doc_id="+code.getDoctorId()))
                        .data(tmplateDatas)
                        .build();
    }
}
